
import React, { useState, useEffect } from 'react';
import { getVisitor } from '../api/index'
const Footer = () => {
  const [vf, setVF] = useState(0)
  useEffect(() => {
    getVisitor()
      .then(res => {
        setVF(res.data.allTimes)
      })
  }, [])
  return (
    <div className="footer-div">
      <div>系统由 React+Node+Ant Desgin驱动 </div>
      <div>
        <span>网站访问人数: {vf}</span>
        <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <a className="icp" href="http://www.beian.miit.gov.cn/" target="_blank">ICP证: 冀ICP备17004987号-1</a>
        </span>
      </div>
      <style jsx>{`
      .footer-div{
        text-align: center;
        width: 100%;
        padding: 1rem;
        color:#888;
        margin-top:2rem;
      }
      .icp{
        cursor: pointer;
      }
      .icp:hover{
        text-decoration: underline;
      }
      `}</style>
    </div>
  )
}
export default Footer
